function Get-InsightCloudDatabaseParameters {
    [CmdletBinding()]
    [OutputType('Parameters')]
    param ([Parameter(Mandatory = $true, Position = 0)][Parameters]$Parameters)

    # Get existing databases on the selected server.
    if ($Parameters.LSInsight.Server.UseExisting -eq 'True') {
        # SelectedServerName/DatabaseName.
        $databasesOnServer = Get-AzSqlDatabase -ResourceGroupName $Parameters.Azure.ResourceGroup -ServerName $Parameters.LSInsight.Server.Name
        # Remove the 'master' database.
        $databasesOnServer = $databasesOnServer | Where-Object { $_.DatabaseName -notmatch '^master$'}
    }
    
    # Use an existing database or create a new one.
    if($Parameters.LSInsight.Database.UseExisting -eq 'True')
    {
        $blocklist = @()
    }
    else {
        $Parameters.LSInsight.Database.UseExisting = 'False'
        $blocklist = $databasesOnServer.DatabaseName
    }
    

    # Let user create a name for the new database.
    $Parameters.LSInsight.Database.Name = Get-NewAzureDatabaseName -Blocklist $blocklist -DatabaseName $Parameters.LSInsight.Database.Name -ConfirmAll $Parameters.ConfirmAll
    
    # Ask for pricing tier.
    $Parameters.LSInsight.Database.PricingTier = Get-DatabasePricingTier -PricingTier $Parameters.LSInsight.Database.PricingTier -ConfirmAll $Parameters.ConfirmAll

    return $Parameters
}